package com.zhang.mapper;

import com.zhang.entity.ExecutionResults;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * User: 张
 * Date: 2024-11-20
 * Time: 20:30
 * Description:
 */
@Mapper
public interface ExecutionResultsMapper {
    @Insert("insert into visions_sort.execution_results (execution_script, execution_time, server_ip, channel_id) " +
            "VALUE (#{executionScript},#{executionTime},#{serverIp},#{channelId})")
    void insertExecutionResults(ExecutionResults executionResults);
    @Update("update visions_sort.execution_results " +
            "set result_code = #{resultCode}," +
            "execution_result = #{executionResult} ," +
            "state = '1'"+
            "where channel_id = #{channelId} and state = 0")
    void updateExecutionResults(ExecutionResults executionResults);

    List<ExecutionResults> getDeviceLog(ExecutionResults executionResults);
}
